home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
.net 2002 March
/
DotNetMagazine-Issue107-Coverdisc-NET107-02-03-PCMac.bin
/
pc
/
PC Software
/
free_browsing
/
DavesQckSearchDbar3-14
/
dqsd.exe
/
searches
/
freetrans.xml
< prev
next >
Wrap
Text File
|
2002-08-30
|
5KB
|
126 lines
<search function="freetrans">
<name>FreeTranslation.com Language Translation</name>
<description>
Translate text or webpages from one language to another.<br/>
<a class="helpboxDescLabels">Switches:</a><br />
<table class="helpboxDescTable">
<tr><td>/from:en</td><td>/to:fr</td><td> - </td><td>English to French</td></tr>
<tr><td>/from:en</td><td>/to:de</td><td> - </td><td>English to German</td></tr>
<tr><td>/from:en</td><td>/to:it</td><td> - </td><td>English to Italian</td></tr>
<tr><td>/from:en</td><td>/to:pt</td><td> - </td><td>English to Portuguese</td></tr>
<tr><td>/from:en</td><td>/to:es</td><td> - </td><td>English to Spanish</td></tr>
<tr><td>/from:en</td><td>/to:no</td><td> - </td><td>English to Norwegian</td></tr>
<tr><td>/from:fr</td><td>/to:en</td><td> - </td><td>French to English</td></tr>
<tr><td>/from:de</td><td>/to:en</td><td> - </td><td>German to English</td></tr>
<tr><td>/from:it</td><td>/to:en</td><td> - </td><td>Italian to English</td></tr>
<tr><td>/from:pt</td><td>/to:en</td><td> - </td><td>Portuguese to English</td></tr>
<tr><td>/from:es</td><td>/to:en</td><td> - </td><td>Spanish to English</td></tr>
</table>
<div class="helpboxDescLabels">Examples:</div>
<table class="helpboxDescTable">
<tr><td>freetrans /from:en /to:es hello how are you</td></tr>
<tr><td>freetrans /from:en /to:es http://www.whitehouse.gov</td></tr>
</table>
</description>
<category>Reference</category>
<link>http://www.freetranslation.com</link>
<contributor>Neel Doshi, Greg Mitchell</contributor>
<form name="freetransfTEXT"
action="http://ets.freetranslation.com:5081/"
method="post">
<input type="hidden" name="Sequence" value="core"/>
<input type="hidden" name="Mode" value="html"/>
<input type="hidden" name="template" value="TextResults2.htm"/>
<input type="hidden" name="Language"/>
<input type="hidden" name="SrcText"/>
</form>
<form name="freetransfURL"
action="http://fets3.freetranslation.com:5081/"
method="post">
<input type="hidden" name="Sequence" value="core"/>
<input type="hidden" name="Language"/>
<input type="hidden" name="Url"/>
</form>
<script><![CDATA[
function freetrans(q)
{
if(nullArgs("freetrans", q))
return false;
else
{
var func_name = "freetrans";
var switch_list = new Array("from", "to");
var args = parseArgs(q, switch_list);
// check if the required switches are set
for (var j = 0; j < switch_list.length; j++)
{
if ( typeof args.switch_val[ switch_list[j] ] == "undefined" || args.switch_val[ switch_list[j] ] == "" )
{
alert(func_name + ": /" + switch_list[j] + " switch must be entered. Type '" + func_name + " ?' to see instructions");
return false;
}
}
// Convert the switches to freetrans text
for (j = 0; j < switch_list.length; j++)
{
// Unfortunately, since we are attempting to match the syntax of this search with the babel search, if
// freetranslations.com adds new languages, the search will need to be modified in this switch statement.
switch ( args.switch_val[switch_list[j]]) {
case "en":
args.switch_val[switch_list[j]] = "English";
break;
case "fr":
args.switch_val[switch_list[j]] = "French";
break;
case "de":
args.switch_val[switch_list[j]] = "German";
break;
case "it":
args.switch_val[switch_list[j]] = "Italian";
break;
case "pt":
args.switch_val[switch_list[j]] = "Portuguese";
break;
case "es":
args.switch_val[switch_list[j]] = "Spanish";
break;
case "no":
args.switch_val[switch_list[j]] = "Norwegian";
break;
default:
alert(func_name + ": /" + switch_list[j] + " switch is not valid. Type '" + func_name + " ?' to see instructions");
return false;
}
}
// Determine if the string is a url or not
var strURL = isURL(args.q);
if (strURL)
{
freetransfURL.Url.value = strURL;
freetransfURL.Language.value = args.switch_val["from"] + "/" + args.switch_val["to"];
submitForm(freetransfURL);
}
else
{
freetransfTEXT.SrcText.value = args.q;
freetransfTEXT.Language.value = args.switch_val["from"] + "/" + args.switch_val["to"];
submitForm(freetransfTEXT);
}
return true;
}
}
]]></script>
<copyright>
Copyright (c) 2002 David Bau
Distributed under the terms of the
GNU Public License, Version 2 (http://www.gnu.org/copyleft/gpl.txt)
</copyright>
</search>